package lab02.test19;

import java.util.Scanner;

/**
 * Created by admin on 2017/10/26.
 */
public class Test {
    public static void main(String[] args) {
        //实现字符串的大小写转换并倒序输出，如输入为“HelloWord”，输出为“DROwOLLEH”
StringBuffer result=new StringBuffer();
        Scanner in=new Scanner(System.in);
        System.out.println("输入需要转换的字符：");
        String string=in.next();
        char tem;
        for (int i=0;i<string.length();i++){
            tem=string.charAt(i);
            if (string.charAt(i)>'a'&&string.charAt(i)<'z'){
                tem=(char)(tem-32);
                result.append(tem);
            }
            else {
                tem=(char)(tem+32);
                result.append(tem);
            }
        }
        System.out.println(result.reverse());
  }
}
